import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/views/home/Home.vue'

Vue.use(Router)

export default new Router({
	routes: [{ //定义重定向路由
			path: "/",
			redirect: "/home",
		},
		{ //定义根路由器
			path: '/home', //路由的路径
			name: 'home', //路由的名字
			component: Home, //路由组件(页面组件，带有一定的功能)
			meta: {
				title: "首页",
				alive: true,
			}
		},
		{ //定义最新动态路由
			path: "/newsmessage",
			component: () => import("@/views/home/components/Newsmessage.vue"),
			name: "newsmessage",
			meta: {
				title: "最新动态",
				alive: true,
			}
		},
		{ //定义社区路由
			path: "/community",
			component: () => import("@/views/community/Community.vue"),
			name: "community",
			meta: {
				title: "社区",
				alive: true,
			}
		},
		{ //定义动态列表路由
			path: "/communityList",
			component: () => import("@/views/community/CommunityList.vue"),
			name: "communityList",
			meta: {
				title: "社区",
				alive: true,
			}
		},
		{ //定义动态列表路由
			path: "/communityVideo",
			component: () => import("@/views/community/CommunityVideo.vue"),
			name: "communityVideo",
			meta: {
				title: "社区",
				alive: true,
			}
		},
		{ //定义学习路由
			path: "/study",
			component: () => import("@/views/study/Study.vue"),
			name: "study",
			meta: {
				title: "学习",
				alive: true,
			}
		},
		{ //定义我的路由
			path: "/my",
			component: () => import("@/views/my/My.vue"),
			name: "my",
			meta: {
				title: "我的",
				alive: true,
			}
		},
		{ //定义发布路由
			path: "/release",
			component: () => import("@/views/release/Release.vue"),
			name: "release",
			meta: {
				title: "发布",
				alive: true,
			}
		},
		{ //定义身份核实路由
			path: "/check",
			component: () => import("@/views/check/Check.vue"),
			name: "check",
			meta: {
				title: "身份核实",
				alive: true,
			}
		},
		{ //定义软件自检路由
			path: "/software",
			component: () => import("@/views/software/Software.vue"),
			name: "software",
			meta: {
				title: "软件自检",
				alive: true,
			}
		},
		{ //定义注册路由
			path: "/register",
			component: () => import("@/views/user/Register.vue"),
			name: "register",
			meta: {
				title: "注册",
				alive: true,
			}
		},
		{ //定义登录路由
			path: "/login",
			component: () => import("@/views/user/Login.vue"),
			name: "login",
			meta: {
				title: "登录",
				alive: true,
			}
		},
		{
			path: "/working",
			component: () => import("@/views/Working.vue"),
			name: "working",
			meta: {
				title: "努力中...."
			},
		},
		{
			path: "*",
			name: "notFound",
			component: () => import( /* webpackChunkName: "notfound" */ '@/views/NotFound.vue'),
			meta: {
				title: "导航页面不存在"
			},
		},
	],
})
